#ifndef _LIKELIHOOD_H
#define _LIKELIHOOD_H

#include "Compiler.h"
#include "Data.h"
#include "PolyZO.h"

double pdfNorm(double x);
double phi(double x);

double PointLogLikelihood(
                const vector<double> & linscores,
                unsigned y,
                const class ModelType& modelType
            );

double PointLogLikelihood(
                const vector<double> & linscores,
                double lifeTime,
                int censorInd,
				double alpha,
				int modelIndex
            );

Vector Stddevs( IRowSet & drs );

double LogLikelihood(
                IRowSet & trainDesignData, // HACK!!! DesignRowSet needed: colId's are 0, 1, 2... 
                const class ModelType& modelType,
                const ParamMatrix& beta
            );

double LogLikelihood(
                RowSetIterator& it,
				int classes,
                const class ModelType& modelType,
                const ParamMatrix& beta
            );

double LogLikelihood(
                MemRowSetIterator& it,
                vector<double> beta,
				double alpha,
				int modelIndex
            );

double LogLikelihoodPenalty(
               	MemRowSetIterator& it,
                vector<double> beta,
				const BayesParameter& bayesParam,
				const ParamMatrix& penalty,
				double alpha,
				int modelIndex, 
				vector<double>& lifeTime, 
				vector<int>& censorInd
            );

double LogLikelihood(
               	MemRowSetIterator& it,
                vector<double> beta,
				double alpha,
				int modelIndex, 
				vector<double>& lifeTime, 
				vector<int>& censorInd
            );

double LogLikelihoodPenalty(
                RowSetIterator& it,
				int classes,
                const class ModelType& modelType,
                const ParamMatrix& beta,
                const BayesParameter& bayesParameter,
				const ParamMatrix & priorScale
            );

double LogPrior(
                const BayesParameter& bayesParameter,
                const ParamMatrix& priorMean,
                const ParamMatrix& priorScale,
                const ParamMatrix& beta
            );

double calcROC( const vector< vector<double> >& allScores,
    const vector<unsigned>& allYs, 
    unsigned k );

vector<double> estprob( const vector<double>& score );


#endif // _LIKELIHOOD_H

